package io.lvdaxian.handwriting.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Thread35 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(2);
        new ThreadLocal<String>();
        executorService.execute(() -> {
            try {
                Thread.sleep(1000);
                System.out.println("Thread1: " + Thread.currentThread().getName());
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });

        executorService.execute(() -> {
            try {
                Thread.sleep(1000);
                System.out.println("Thread2: " + Thread.currentThread().getName());
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });

        executorService.execute(() -> {
            try {
                Thread.sleep(1000);
                System.out.println("Thread3: " + Thread.currentThread().getName());
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
    }
}
